const galleries = require("express").Router();
const { Validator, gallery } = require("../../../validators");
const GalleryController = require("../../../controllers/gallery");
// 获取图库列表
galleries.get("/", GalleryController.list);
// 添加图库
galleries.post("/", Validator(gallery.add), GalleryController.add);
// 删除图库
galleries.delete("/:id", Validator(gallery.delete), GalleryController.delete);
// 更新图库[name thumbnail isActive]
galleries.patch("/:id", Validator(gallery.update), GalleryController.update);
// 获取图库下的图集列表
galleries.get(
    "/:id/collections",
    Validator(gallery.collections),
    GalleryController.collections
);

module.exports = galleries;
